Open
Conversation
alicebob
commented
Apr 12, 2020
| import "./variety-common/Answer.js"; | ||
| import "./variety-common/BoardExec.js"; | ||
| import "./variety-common/Encode.js"; | ||
| import "./variety-common/FileData.js"; |
Contributor
Author
There was a problem hiding this comment.
All of these change common in the classmgr. It's likely nicer to do this differently, but it works for now.
alicebob
commented
Apr 12, 2020
| var userlang = pzpr.env.node | ||
| ? process.env.LANG | ||
| var userlang = env.node | ||
| ? "XXX" // process.env.LANG |
Contributor
Author
There was a problem hiding this comment.
This one I have no idea how to fix. There is no process variable when using rollup, which is something which comes from nodejs.
These objects are sometimes "frozen", which raises an error in strict mode: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Read-only
(tried grunt-rollup, but it was... weird)
From 6? That looks ancient.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This changes the
pzprmodule to hang together usingimport ... from ...(the modern way to do imports nowadays, it seems).Previously the
pzprmodule was build by concating all files together, and then use Grunt to uglify the result. Now there is a single/src/pzpr.jswhichimports all required modules. It's converted to something the browser can use viarollup. Thepzpr.jsfile still builds a globalpzprobject, since the UI module andrules.htmlexpect that. The idea is that nothing changes in the final JS file.You can kinda use this directly from nodejs now, but support for the ES6 modules seems iffy.
mochauses theesmmodule which works nicely.notes
All variants must still be ported. I only did 2 of them so far. Until then tests will breakedit: done, and tests passgit.versionstring inpzpr/core.jsyetrollupcan do "chunks", if you prefer smaller files over something huge.deploy
rollupaction a makefile target, but there is a rolllup grunt module, so that could be used instead(I had some troubles with it, will try again later)edit: I tried again and fails. Makefile it is.candlefile doesn't get bundled, so that's an explicit copy to ./dist/ nowES6 modules crash course
Either there are multiple things exported:
Or there is a single thing:
Evaluation
I do think using the ES6 modules is a good goal. It's a nice modernization step. It's unfortunately way too many changes for a single PR. What I can do is break this up in smaller PRs, which would still use some concatenation, and then work towards the state in this PR in a few separate, smaller, steps.